//
//  HoVPHeaderView.m
//  HOrangiOS
//
//  Created by YOrange on 2018/5/7.
//  Copyright © 2018年 YOrange. All rights reserved.
//

#import "HoVPHeaderView.h"
#import "HoVPHeadData.h"
@interface HoVPHeaderView()

@property (strong, nonatomic) NSMutableArray <UIButton *>* btnArr;

@end


@implementation HoVPHeaderView

///头部样式，平分，可以滑动的
-(void)config{
    
}

-(NSMutableArray <UIButton *>*)btnArr{
    if (_btnArr == nil) {
        _btnArr = [NSMutableArray array];
    }
    return _btnArr;
}

-(void)publicConfig:(HoVPHeadData *)data{
    int w = [UIScreen mainScreen].bounds.size.width / data.titleArr.count;
    for (int i = 0; i < data.titleArr.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(0 + w * i, 0, w, 50);
        btn.titleLabel.font = [UIFont systemFontOfSize:12];
        [btn setTitle:data.titleArr[i] forState:UIControlStateNormal];
        if (i == 0) {
            [btn setTitleColor:data.btnSelectColor forState:UIControlStateNormal];
        }else{
            [btn setTitleColor:data.btnNoColor forState:UIControlStateNormal];
        }
        [self.btnArr addObject:btn];
        [self addSubview:btn];
    }
}

-(void)drawLine:(HoVPHeadData *)data{
    ///滑动线条的长度 1为跟随字体长度 2为平分屏幕 >3 固定长度
    if (data.lineLength == 1) {
        
    }else if (data.lineLength == 2){
        
    }else{
        
    }
}


@end
